/**
 * 
 */
package pl.softech.gpw.dao.ds;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Logger;


/**
 * @author ssledz
 *
 */
public class RemoteBossaDataSource {

	protected final Logger logger = Logger.getLogger(RemoteBossaDataSource.class.getName());
	
	private final static String DEFAULT_HOST = "bossa.pl";
	
	private URL url;
	private String host;

	public RemoteBossaDataSource() throws MalformedURLException {
		this(DEFAULT_HOST);
	}
	
	private RemoteBossaDataSource(String url) throws MalformedURLException {
		this.host = DEFAULT_HOST;
		this.url = new URL("http://" + host + "/" + url);
	}
	
	public URL getUrl() {
		return url;
	}

	public String getHost() {
		return host;
	}
	
	public static RemoteBossaDataSource createRemoteRealTimeDataSource() throws MalformedURLException {
		return new RemoteBossaDataSource("pub/ciagle/omega/cgl/ndohlcv.txt");
	}

	public static RemoteBossaDataSource createRemoteDbDataSource() throws MalformedURLException {
		return new RemoteBossaDataSource("pub/ciagle/mstock/mstcgl.zip");
	}
	
}
